# output.copy

- **Type:** `Rspack.CopyRspackPluginOptions | Rspack.CopyRspackPluginOptions['patterns']`
- **Default:** `undefined`

Copies the specified file or directory to the dist directory, implemented based on [rspack.CopyRspackPlugin](https://rspack.dev/plugins/rspack/copy-rspack-plugin).

> Please refer to the configuration options here: [rspack.CopyRspackPlugin](https://rspack.dev/plugins/rspack/copy-rspack-plugin).

## Example

Copy files from `./src/assets` to the `./dist` directory:

```js
export default {
  output: {
    copy: [
      // `./src/assets/image.png` -> `./dist/image.png`
      { from: './src/assets' },
    ],
  },
};
```

Copy files from `./src/assets` to the `./dist/assets` directory:

```js
export default {
  output: {
    copy: [
      // `./src/assets/image.png` -> `./dist/assets/image.png`
      { from: './src/assets', to: 'assets' },
    ],
  },
};
```
